import axios from "@/utils/request";
import {Chat} from "@/model/personalCenter/myFriends";

//获取当前用户的好友申请列表
export function getUserFriendApplyList(userId: number) {
    return axios({
        url: "/makeFriend/friend/web/getUserFriendApplyList/" + userId,
        method: "get"
    })
}

//当前用户同意或拒绝好友申请
export function agreeOrRejectFriendApply(userId: number, friendId: number, type: string) {
    return axios({
        url: `/makeFriend/friend/web/agreeOrRejectFriendApply/${userId}/${friendId}/${type}`,
        method: "put"
    })
}

//获取当前用户的好友列表
export function getUserFriendList(userId: number) {
    return axios({
        url: "/makeFriend/friend/web/getUserFriendList/" + userId,
        method: "get"
    })
}

//朋友聊天
export function friendChat(chat: Chat) {
    return axios({
        url: "/makeFriend/chat/web/friendChat",
        method: "post",
        data: chat
    })
}

//获取当前用户的好友聊天内容
export function getUserFriendChatContent(userId: number, friendId: number) {
    return axios({
        url: `/makeFriend/chat/web/getUserFriendChatContent/${userId}/${friendId}`,
        method: "get"
    })
}